<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center cardAndSafe_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub cardAndSafe_fd0_0'>
				<view class='flex flex-wrap align-center'>
					<person></person>
				</view>
				<view class='flex flex-wrap align-stretch justify-center flex-sub'>
					<text class='cardAndSafe_fd0_0_c1_c0'>安全设置</text>
				</view>
				<view class='flex flex-wrap align-center cardAndSafe_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<!---账号与安全两列flex布局开始-->
		<view class="flex flex-direction flex-wrap align-stretch cardAndSafe_flex_1">
			<view style="padding: 8rpx 0;">
				<back></back>
			</view>
			<view class='flex flex-wrap align-center justify-between cardAndSafe_fd1_0' @tap.stop="handleJumpDiy"
				data-type="navigateTo" :data-url="`/pages/xtsz/changePwd/changePwd`">
				<text class='cardAndSafe_fd1_0_c0'>修改密码</text>
				<text class='fu-iconfont2  cardAndSafe_fd1_0_c1'>&#xE7F2;</text>
			</view>
			<view class='flex flex-wrap align-center justify-between cardAndSafe_fd1_0' @tap.stop="getsetpay">
				<text class='cardAndSafe_fd1_0_c0'>修改支付密码</text>
				<text class='fu-iconfont2  cardAndSafe_fd1_0_c1'>&#xE7F2;</text>
			</view>
			<view class='flex flex-wrap align-center justify-between cardAndSafe_fd1_0' @tap.stop="handleJumpDiy"
				data-type="navigateTo"
				:data-url="`/pages/xtsz/changeBingDingPhone1682231418/changeBingDingPhone1682231418`">
				<text class='cardAndSafe_fd1_0_c0'>修改绑定手机号</text>
				<text class='fu-iconfont2  cardAndSafe_fd1_0_c1'>&#xE7F2;</text>
			</view>
			<view class='flex flex-wrap align-center justify-between cardAndSafe_fd1_3' @tap.stop="handleJumpDiy"
				data-type="navigateTo" :data-url="`/pages/xtsz/emailChange/emailChange`" v-show="usefInfo.sex==2 && is_hide == 0">
				<text class='cardAndSafe_fd1_0_c0'>修改邮箱</text>
				<text class='fu-iconfont2  cardAndSafe_fd1_0_c1'>&#xE7F2;</text>
			</view>
			<view class='flex flex-wrap align-center justify-between cardAndSafe_fd1_0' @tap.stop="getzhuxiao">
				<text class='cardAndSafe_fd1_0_c0'>注销账号</text>
				<text class='fu-iconfont2  cardAndSafe_fd1_0_c1'>&#xE7F2;</text>
			</view>
		</view>

		<!---账号与安全两列flex布局结束-->
		<!---flex布局flex布局开始-->
		<view class="flex benben-flex-layout flex-wrap align-center cardAndSafe_flex_2">
			<button class='cardAndSafe_fd2_0' @tap.stop="popupShow1681268717363=true">退出登录</button>
		</view>

		<!---flex布局flex布局结束-->
		
		<benben-popup v-model="popupShow1681268717363" :mask="true" mode='center'>
			<view class="flex flex-direction flex-wrap align-center system_flex_3">
				<text class='system_fd3_0'>提示</text>
				<text class='system_fd3_1'>确定退出当前账号？</text>
				<view class='flex flex-wrap align-center system_fd3_2'>
					<button class='system_fd3_2_c0' @tap.stop="popupShow1681268717363=false">取消</button>
					<button class='system_fd3_2_c1' @tap.stop="logOutFunc()">确定</button>
				</view>
			</view>
		</benben-popup>

	</view>
</template>
<script>
	import back from "@/components/back/index.vue"
	import person from "@/components/person/index.vue"
	export default {
		components: {
			back,
			person
		},


		data() {
			return {
				popupShow1681268717363: false,
				usefInfo: {
					sex: 2
				},
				is_hide: 1
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getuser()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.postHide();
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			// 是否隐藏三方  post64fabe4eafefc
			postHide() {
				this.$api.post(global.apiUrls.post64fabe4eafefc, {
					
				}).then(res => {
					// console.log(res);
					if (res.data.code == 1) {
						this.is_hide = res.data.data.is_hide;
					}
				})
			},
			//获取信息
			async getuser() {
				let id1 = uni.getStorageSync("USER_INFO")
				this.userid = id1.id
				console.log(this.userid, 'userid')
				let res = await this.$api.post(global.apiUrls.userinfo, {
					user_id: this.userid,
				});
				if (res.data.code != 1) {
					this.$message.info(res.data.msg)
					return
				}
				this.usefInfo = res.data.data
				console.log(this.usefInfo, 'this.usefInfo')
			},
			async getsetpay() {
				let res = await this.$api.post(global.apiUrls.a6483dd30d089c, {})
				if (res.data.code != 1) {
					this.$message.info(res.data.msg)
					return
				}
				if (res.data.data.is_set == 0) {
					this.$message.info('您还没有设置支付密码');
					setTimeout(() => {
						this.$urouter.navigateTo('/pages/xtsz/setpay/setpay')
					}, 800)
				} else {
					this.$urouter.navigateTo('/pages/xtsz/payChange/payChange')
				}
			},
			async getzhuxiao() {
				this.$urouter.navigateTo('/pages/xtsz/accountCancellation/accountCancellation');
				return;
				
				
				
				let res = await this.$api.post(global.apiUrls.a64367eab91916, {})
				if (res.data.code != 1) {
					this.$message.info(res.data.msg)
					return
				}
				if (res.data.data.status == -1) {
					setTimeout(() => {
						this.$urouter.navigateTo('/pages/xtsz/accountCancellation/accountCancellation')
					}, 500)
				} else if (res.data.data.status == 0) {
					this.$urouter.navigateTo(
						`/pages/xtsz/accountCancellationSubmission/accountCancellationSubmission?type=2`)
				} else if (res.data.data.status == 1) {
					this.$store.commit('logout')
					this.toLoginDiy();
				}
			},
			//退出登录
			logOutFunc() {
				this.tim.logout();
				this.$store.commit('logout');
				// #ifdef APP-PLUS
				this.TUICallKit.logout();
				// #endif
				uni.reLaunch({
					url: '/pages/tabBar/login/login'
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.system_flex_3 {
		background: #fff;
		width: 540rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}
	
	.system_fd3_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		line-height: 110rpx;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: rgba(0, 0, 0, 1.0);
		width: 270rpx;
	}
	
	.system_fd3_2_c0 {
		border-top: 1px solid #eee;
		background: #fff;
		line-height: 110rpx;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		padding: 0rpx 103rpx 0rpx 103rpx;
	}
	
	.system_fd3_2 {
		margin: 37rpx 0rpx 0rpx 0rpx;
	}
	
	.system_fd3_1 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}
	
	.system_fd3_0 {
		font-size: 36rpx;
		font-weight: 800;
		line-height: 44rpx;
		color: #333333;
		margin: 40rpx 0rpx 40rpx 0rpx;
	}
	.home_img {
		width: 40rpx;
		height: 40rpx;
	}
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: var(--benbenbgColor1);
		background-size: 100% auto !important;
	}

	.cardAndSafe_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.cardAndSafe_fd0_0_c2 {
		width: 40rpx;
		height: 40rpx;
	}

	.cardAndSafe_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.cardAndSafe_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.cardAndSafe_fd0_0 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.cardAndSafe_flex_1 {
		background: #fff;
		font-size: 32rpx;
		background-size: 100% auto !important;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.cardAndSafe_fd1_3 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.cardAndSafe_fd1_0_c1 {
		font-size: 26rpx;
		color: rgba(191, 191, 191, 1);
		font-weight: 400;
	}

	.cardAndSafe_fd1_0_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.cardAndSafe_fd1_0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.cardAndSafe_flex_2 {
		height: 88rpx;
		position: fixed;
		bottom: 64rpx;
		left: 30rpx;
	}

	.cardAndSafe_fd2_0 {
		background: #6A0002;
		border-radius: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #fff;
		width: 690rpx;
		height: 88rpx;
		line-height: 88rpx;
	}
</style>